package com.chenbei.system.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.chenbei.common.domain.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

@EqualsAndHashCode(callSuper = true)
@Schema
@Data
@TableName("sys_organization")
@NoArgsConstructor
@AllArgsConstructor
public class SysOrganization extends BaseEntity {

    @Schema(description = "主键ID")
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    @Schema(description = "父ID")
    @TableField("pid")
    private Long pid;

    @Schema(description = "组织名称")
    @TableField("name")
    @NotBlank(message = "组织部门不能为空")
    private String name;

    @Schema(description = "简介")
    @TableField("introduction")
    private String introduction;

    @Schema(description = "状态[1:启用|2:禁用]")
    private Integer status;

    @Schema(description = "负责人")
    @TableField("manager_id")
    private Long managerId;

    @Schema(description = "负责人名称")
    @TableField(exist = false)
    private String managerName;

    @Schema(description = "排序")
    @TableField("sort")
    private Integer sort;
}
